package com.wlw.service;

import java.util.List;

import org.junit.Test;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

import com.wlw.entity.City;
import com.wlw.entity.Gonglue;
import com.wlw.entity.QA;
import com.wlw.entity.QAreply;
import com.wlw.entity.Scenery;

import edu.xjsoft.base.orm.support.PropertyFilter;

public class test {

//	public void test0(){
//		CityService cityService = new CityService(); 
//		cityService.aaa();
//		System.out.println("!!!!!!!!!!!!!!!!");
//	}
	ApplicationContext atx = new ClassPathXmlApplicationContext("beans.xml");
//	@Test
//	public void testHotCity(){
//		CityService service2 = (CityService)atx.getBean("cityService");
//		System.out.println("运行至此："+service2.hotCities().get(0).getName());
//	}
//	@Test
//	public void testHomeHotScenery(){
//		SceneryService sceneryService = (SceneryService) atx.getBean("sceneryService");		
//		System.out.println("运行到这里："+sceneryService.homeHotScenery().get(0).getZanCount());
//	}
	
//	@Test
//	public void test3(){
//		CityService cityService = (CityService) atx.getBean("cityService");
//		List<City> allHomeCities = cityService.homeCityClass();
//		System.out.println("QQQQQ!");
//		
//		System.out.println("这是："+allHomeCities.size());
//		
//	}
//	@Test
//	public void test4(){
//		GonglueService gonglueService = (GonglueService) atx.getBean("gonglueService");
//		List<Gonglue> hotGonglues3 = gonglueService .hotGonglues3();
//		System.out.println("TEST:"+hotGonglues3.size());		
//	}
//	@Test
//	public void test5(){
//		CityService cityService = (CityService) atx.getBean("cityService");
//		List<City> chun = cityService.chunCities();
//		System.out.println("春："+chun.size());
//	}
//	@Test
//	public void test6(){
//		SceneryService sceneryService = (SceneryService) atx.getBean("sceneryService");
//		List<Scenery> sceneries = sceneryService.searchScenery("红");
//		for (int i = 0; i < sceneries.size(); i++) {
//			System.out.println(sceneries.get(i).getName());
//		}
//	}
	@Test
	public void test6(){
		String title = "aaa";
		PropertyFilter filters = new PropertyFilter("title", title);
		QAService qaService = (QAService)atx.getBean("QAService");
		List<QA> qas = qaService.search(filters);
		System.out.println(qas.size());
		System.out.println("QQQQ:");//+qas.get(0).getUser().getUname()
		System.out.println(qas.get(0).getqAreplies().isEmpty());
//		List<QAreply> qAreplies = (List<QAreply>) qas.get(0).getqAreplies();
//		System.out.println(qAreplies.get(0).getContent());
	}
}
